<?php

use think\facade\Route;

Route::group('third', function () {

    // 小程序登陆+公众号登陆+移动应用登陆
    Route::post('wechat/login', 'api.third.Wechat/login');
    // 小程序code换sessionKey
    Route::POST('wechat/getSessionId', 'api.third.Wechat/getSessionId');
    // 公众号授权
    Route::any('wechat/oauthLogin', 'api.third.Wechat/oauthLogin');
    // SignInWithApple
    Route::any('apple/login', 'api.third.Apple/login');
    // 使用头像和昵称
    Route::get('refresh', 'api.Third/refresh');
    // 网页JSSDK
    Route::get('wechat/jssdk', 'api.third.Wechat/jssdk');
    // 微信小程序码
    Route::get('wechat/wxacode', 'api.third.Wechat/wxacode');
    // 小程序模板消息
    Route::get('wechat/subscribeTemplate', 'api.third.Wechat/subscribeTemplate');


    // 需登陆
    Route::group(function () {
        // 微信绑定
        Route::post('wechat/bind', 'api.third.Wechat/bind');
        // 解除绑定
        Route::post('wechat/unbind', 'api.third.Wechat/unbind');
        // 获取手机号-必须登录
        Route::post('wechat/bindUserPhoneNumber', 'api.third.Wechat/bindUserPhoneNumber');
    })->middleware('check_login', 'user');
});
